//import router from '../router'
import { useAdminInfo } from '../store/adminInfo'
import { useNavTabs } from '../store/navTabs'
import { useSiteConfig } from '../store/siteConfig'
const siteConfig = useSiteConfig()

const adminInfo = useAdminInfo()
const navTabs = useNavTabs()

export function pulldata() {
    pulladmin();
    tabsViewRoutes();
}

function pulladmin(){
    adminInfo.dataFill({
        id: 0,
        username: 'ui测试',
        nickname: '小缘',
        avatar: 'https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/d62a6059252dd42a77bcdf1d0b3b5bb5c8eab8cb.jpg',
        last_login_time: '2024-01-01',
        token: 'test_token',
        refresh_token: 'test_refresh_token',
        // 是否是superAdmin，用于判定是否显示终端按钮等，不做任何权限判断
        super: true,
    });
    siteConfig.dataFill({
        siteName: '地府阴德管理系统',
        recordNumber: '001',
        version: '22222',
        cdnUrl: '',
        apiUrl: '',
        upload: {
            mode: 'local',
            maxsize: 0,
            mimetype: '',
            savename: '',
        },
        headNav: [],
        initialize: true,
        userInitialize: true,
    })
}

function tabsViewRoutes(){
    navTabs.setTabsViewRoutes([
        {
            path: '/cshome',
            name: 'rust测试',
            meta: {
                id: 1,
                title: '测试首页',
                icon: 'el-icon-HomeFilled',
                keepalive: true,
                menu_type: 'tab',
                type: 'menu',
                addtab: true
            },
            children: []
        },
        {
            path: 'test',
            name: '测试',
            meta: {
                id: 2,
                title: '测试',
                icon: 'el-icon-Menu',
                keepalive: true,
                menu_type: 'tab',
                type: 'menu_dir',
                addtab: false
            },
            children: [
                {
                    path: '/rustfutest',
                    name: 'rust测试',
                    meta: {
                        id: 3,
                        title: 'rust测试',
                        icon: 'el-icon-HomeFilled',
                        keepalive: true,
                        menu_type: 'tab',
                        type: 'menu',
                        addtab: true
                    },
                    children: []
                }
            ]
        },
        
])
}

export default pulldata